package com.csoa.community.activity;

import android.content.Intent;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.VideoView;

import com.collect.community.R;
import com.csoa.community.utils.AndroidUtils;
import com.csoa.community.utils.StringUtils;

public class TestActivity extends BaseActivity {

	private LinearLayout layoutImg;
	private Button btnCamera;

	@Override
	public void initUI() {
		
		setContentView(R.layout.test);
		layoutImg = (LinearLayout)this.findViewById(R.id.test);
		btnCamera = (Button)this.findViewById(R.id.btnCamera);
		btnCamera.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(
						MediaStore.ACTION_IMAGE_CAPTURE);
				startActivityForResult(intent, 1);
			}
		});
	}

	@Override
	public void initData() {

	}
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == RESULT_OK) {
//			if(requestCode == 1) {
//				ImageView img = this.showImg(layoutImg, data);
//				if(img != null && img.getTag() != null) {
//					final String path = (String)img.getTag();
//					if(!StringUtils.isEmpty(path)) {
//					}
//					img.setOnClickListener(new View.OnClickListener() {
//						
//						@Override
//						public void onClick(View v) {
//							AndroidUtils.fileInvoke(TestActivity.this, path);
//						}
//					});
//				}
//				
//			}
			
		}
	}

}
